<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      button {
        position: absolute;
      }
    </style>
  </head>
  <body>
    <button>houdunren</button>
    <!-- <button>hdms</button> -->
    <script>
      let btns = document.querySelectorAll("button");
      btns.forEach(function (item) {
        let time = null;
        item.addEventListener("click", function () {
          if (time) {
            clearInterval(time);
          }
          let left = 1;
          time = setInterval(() => {
            item.style.left = left++ + "px";
          }, 10);
        });
      });
    </script>
  </body>
</html>
